package cn.gson.crm.controller;

import cn.gson.crm.model.pojos.Stock;
import cn.gson.crm.model.pojos.StockDetails;
import cn.gson.crm.model.service.StocksService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/StockController")
public class StockController {
    @Autowired
    StocksService stocksService;
    @RequestMapping("/ContractMethod")
    @ResponseBody
    public void save(@RequestBody Stock stock){
        stocksService.savestocl(stock);
    }
    @RequestMapping("/ContractMethod2")
    @ResponseBody
    //库存查询所有库存记录
    public Map<String,Object> selectkucunsy(Integer page, Integer size){

        return stocksService.selectkucunsy(page,size);
    };
    @RequestMapping("/ContractMethod3")
    @ResponseBody
    public Map<String,Object>  selectkucunsywhere(String where,Integer page, Integer size){
        return stocksService.selectkucunsywhere(where,page,size);
    };
}
